/*
TO DO:

*/

#ifndef MENU_H
#define MENU_H

#include <vector>
#include <string>
#include "Book.h"
#include "LibraryMember.h"
#include "Librarian.h"

class Menu
{
    private:
        std::vector<Book*> Books; // konyveket tarolo vektor
        std::vector<LibraryMember*> LibraryMembers; // tagokat tarolo vektor
        unsigned int MenuID;
        std::string menu_private_BookID;
    public:
        Menu(); // ctor (adatok betoltese)
        virtual ~Menu(); // dtor (adatok mentese)
        void LoadData(); // adatok betolteset vegzo fv (hibas fajlnal kivetelt dob)
        void SaveData(); // adatok kimenteset vegzo fv (hiba eseten kivetelt dob)
        void RunMenu(std::string MenuType = "main");
        void WriteMenu(const std::string MenuType = "main") const;

        bool Login();
        void SearchBook();
        bool SearchBookID(int& BookID, bool inin = true);
        bool SearchMemberID(int& MemberID);
        void ManageBook(std::string MenuType = "list");
        void ManageMember(std::string MenuType = "list");
        void Loan(); // kolcsonzes adott tag altal
        void Return(); // konyv visszavetele
        int Return(LibraryMember* mitmit); // visszater a kesessel (int)

        bool RealMemberID(int &i); // bekert ID-rol eldonti, hogy letezo LibraryMemberID-e vagy sem
        bool RealBookID(const std::string& realbookid, bool which_RealBookID = true); //
        int GetLoanableBooks(bool Loanable=true); // kolcsonozheto konyvek keresese //Speclist()

        Librarian *Librarian_PtoLibrarian; // a bejelentkezett felhasznalora mutato pointer
        int GetInt(const std::string& msg) const;
        void ClearCin() const;
        char ToLower(char mitmit);
        enum Exception {MISSING_FILE,BAD_INPUT,AUTH_FAILURE,BAD_AUTHFILE};
};
#endif // MENU_H
